package org.jason.user.mq.consumer;

import org.jason.model.user.dtos.ChangeAvatarDto;
import org.jason.user.service.ICuUserService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserConsumer {

    @Autowired
    private ICuUserService userService;

    //监听用户头像修改
    @RabbitListener(queues = "user.avatar.queue")
    public void receiveUserAvatar(ChangeAvatarDto dto) {
        userService.changeAvatar(dto);
    }
}
